<template>
  <div>
    <el-container>
      <el-header>
        <el-row>
          <el-col :span="8">
            logo
          </el-col>
          <el-col :span="8">

          </el-col>
          <el-col :span="8" style="float: right">
            <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
              <el-menu-item index="1">首页</el-menu-item>
              <el-menu-item index="2">关于我们</el-menu-item>
              <el-menu-item index="3">服务项目</el-menu-item>
              <el-menu-item index="4">新闻中心</el-menu-item>
              <el-menu-item index="5">联系我们</el-menu-item>
            </el-menu>
          </el-col>
        </el-row>
      </el-header>
      <el-main>
        <el-carousel :interval="4000" type="card" height="400px">
          <el-carousel-item v-for="(item,index) in imgs" :key="index">
            <el-image
                style="height: 400px;width: 1300px"
                :src="item"
                fit="cover"></el-image>
          </el-carousel-item>
        </el-carousel>
      </el-main>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "Main",
  data() {
    return {
      activeIndex: '1',
      imgs: [
        require('@/assets/image/image01.jpg'),
        require('@/assets/image/image02.jpg'),
        require('@/assets/image/image03.jpg'),
        require('@/assets/image/image04.jpg'),
        require('@/assets/image/image05.jpg'),
      ]
    }
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    }
  }
}
</script>

<style scoped>
.el-carousel__item h3 {
  color: #475669;
  font-size: 18px;
  opacity: 0.75;
  line-height: 300px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n+1) {
  background-color: #d3dce6;
}
</style>